package com.example.demo.zaqizabatest.cglib;

import com.example.demo.user.entity.User;
import com.example.demo.zaqizabatest.common.MyTransaction;
import org.apache.commons.lang3.ObjectUtils;

/**
 * @ClassName Test
 * @Author lys4134
 * @Date 2021/08/12 09:58:23
 * @Description Test
 * @Version 1.0
 **/
public class Test {
    public static void main(String[] args) {
        System.out.println(testObjectEquals());
        Object target = new PersonServiceImpl123();
        MyTransaction myTransaction = new MyTransaction();
        PersonServiceInterceptor interceptor = new PersonServiceInterceptor(target, myTransaction);
        PersonServiceImpl123 personService = (PersonServiceImpl123) interceptor.createProxy();
        String returnValue = (String) personService.savePerson();
        System.out.println(returnValue);
    }

    private static boolean testObjectEquals() {
        User user1 = new User();
        user1.setId("1");
        User user2 = new User();
        user2.setId("1");
        return ObjectUtils.equals(user1, user2);
    }
}
